/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.compomics.dataprovider.testingutilities;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

/**
 *
 * @author Kenneth
 */
public class StreamContentChecker {

    public static boolean contentEquals(InputStream input1, InputStream input2) throws IOException {
        BufferedReader reference = new BufferedReader(new InputStreamReader(input1));
        BufferedReader checker = new BufferedReader(new InputStreamReader(input2));
        String refLine;
        while ((refLine = reference.readLine()) != null) {
            String checkerLine = checker.readLine();
            System.out.println("REF : " + refLine);
            System.out.println("PRO : " + checkerLine);
            if (!refLine.equalsIgnoreCase(checkerLine)) {
                return false;
            }
        }
        return true;
    }
}
